<?php
/**
 * Created by PhpStorm.
 * User: mac
 * Date: 2021/6/11
 * Time: 10:45 PM
 */

namespace Modules\Permission\Services;
use Modules\Common\Services\BaseService;
use Modules\Common\Services\CommonService;
use Modules\Permission\Entities\Permission;
class PermissionService extends BaseService
{
    private $service;

    public function __construct(CommonService $service)
    {
        $this->service = $service;

    }
    public function queryPermissions(){
       return Permission::query()->select('group')->groupBy('group');
    }
    public function store(array $data){
        $this->service->setPermission(new Permission(),$data);
        return $this->service->store();
    }
}
